function Room() {
    this.storeRoom = {};
    this.lisRoom = [];

    this.storeAnimal = function () {
        for (var i = 0; i < 10; i++) {
            var ra = Math.round(10 * Math.random());
            if(ra % 2 == 0){
                this.lisRoom[i] = 1;
                this.storeRoom[i.toString()] = new Sheep();
            }else{
                this.lisRoom[i] = 0;
                this.storeRoom[i.toString()] = new Tiger();
            }
            console.log(this.lisRoom[i]);
        }
    }

    this.getAnimal = function (roomNum) {
            return this.storeRoom[roomNum.toString()];
    }

    this.getAllanimal = function () {
        for(var i = 0;i<10;i++){
            var a = this.lisRoom[i];
            var b = this.storeRoom[i.toString()]
            if(a == 1){
                document.write("第"+(i+1)+"个房间是：羊"+"  体重是："+b.weight+"</br>");
            }else{
                document.write("第"+(i+1)+"个房间是：虎"+"  体重是："+b.weight+"</br>");
            }
        }
    }
}
